package at.ac.lbg.media.vis.client.theme.render
{
	
	import at.ac.lbg.media.vis.client.theme.view.Artwork;
	
	import flare.vis.data.DataSprite;
	
	import flash.display.Graphics;
	import flash.display.Shape;
	import flash.geom.Point;
	import flash.utils.Dictionary;
		
	public class HexRenderer implements IArtworkRenderer
	{
		private var flowerR:FlowerRenderer;
		private var catDict:Dictionary;
		
        private var borderColor:uint  = 0x666666;
        private var borderSize:uint   = 1;

				
		public function HexRenderer() {
			flowerR = new FlowerRenderer();
		}

		public function setDefaultSize(size:Number):void
		{
			flowerR.setDefaultSize(size);
		}
		
		public function render(d:DataSprite):void {
						
			var hex:Shape = new Shape();
			hex.graphics.lineStyle(borderSize, borderColor);
	
			var artwork:Artwork = d as Artwork;
			var innerRadius:Number = 28;
			var h:Number = 0.5*Math.sqrt(3)*innerRadius;
			
		for (var i:Number = 0; i < 7; i++) {
				
				var triangleShape:Shape = new Shape();
				
				triangleShape.graphics.lineStyle(borderSize, borderColor);
				triangleShape.graphics.moveTo(0,innerRadius);
				triangleShape.graphics.lineTo(h,innerRadius/2);
				triangleShape.rotation = 90+(60*i);
				
				artwork.addChild(triangleShape);
		}
			
			flowerR.render(d);
			//hexRenerer();
		}

		public function hexRenderer():void{
		
		}				
	}


}